<!DOCTYPE html>
<html lang="en">
<head th:include="certificateWeb/headFoot :: headerCss">
</head>
<link rel="stylesheet" href="/css/certificateWeb/workNews/workNews.css">

<body id="body">
<div th:include="certificateWeb/headFoot :: header"></div>
<main id="main">
    <section class="sec_1">
        <div class="div_1">
            <ul>
                <li class="this"><a href="/certificate/testingCentreQuery">考核站点查询</a></li>
                <li><a href="/certificate/testingCentreQueryPx">培训基地查询</a></li>
                <li><a href="/certificate/certificateQuery">证书查询</a></li>
                <li><a href="/certificate/expertQuery">专家查询</a></li>
            </ul>
        </div>
        <div class="div_2">
            <label  class="label_title">考点查询</label>
            <hr/>
                <div class="flex_a">
                    <input type="text" name="name" id="name" placeholder="请输入考点名称" class="form-control">
                    <input type="button" id="btn" class="form-control but_2" value="查询" onclick="getList()"/>
                </div>
            <div class="div_5">
                <div id="news"></div>
                <div style="clear: both"></div>
                <div id="page"></div>

            </div>
        </div>
        <div style="clear: both"></div>
    </section>
</main>
<div th:include="certificateWeb/headFoot :: footer"></div>
</body>
<script>
    $(function () {
        getList()
    });
    function getList(num) {
        $.ajax({
            url: "/jzApi/organizion/selExaminationPoint",
            type: 'GET',
            data: {
                current: 1,
                number:5,
                type:5,
                name:$("#name").val().trim()
            },
            success: function (res) {
                if(res.data.pages==0){
                    $("#news").html('<div class="noData">暂无数据</div>');
                }else{
                    var list = res.data.records;
                    var news = '';
                    list.forEach(function (item, index) {
                        news += '<div class="div_7 div_01">' +
                            '<div class="span_1 b18"><span class="title_1">考点名称：</span><p class="title_2">' + item.name + '</p></div>' +
                            '<div class="span_1 b18"><span class="title_1">考点地址：</span><p class="title_2">' + item.address + '</p></div>' +
                            '<div class="span_1 b18"><span class="title_1">考点联系人：</span><p class="title_2">' + item.contacts + '</p></div>' +
                            '<div class="span_1 b18"><span class="title_1">联系人手机号：</span><p class="title_2">' + item.mobile + '</p></div>' +
                            '<div class="span_1 b18"><span class="title_1">负责证书：</span><p class="title_2">' + item.profileName + '</p></div>' +
                            '</div>';
                    });
                    $("#news").html(news);
                        page(1,res.data.pages);

                }
            }
        });
    }
    function page(num,tolPages) {
        console.log("num",num)
        $("#page").paging({
            nowPage:num, // 当前页码
            pageNum:tolPages, // 总页码
            buttonNum:10, //要展示的页码数量
            canJump: 1,// 是否能跳转。0=不显示（默认），1=显示
            showOne: 0,//只有一页时，是否显示。0=不显示,1=显示（默认）
            callback: function (num) { //回调函数
                $.ajax({
                    url: "/jzApi/organizion/selExaminationPoint",
                    type: 'GET',
                    data: {
                        current: num,
                        number:5,
                        type:5,
                        name:$("#name").val().trim()
                    },
                    success:function (res) {
                        var list = res.data.records;
                        var news = '';
                        list.forEach(function (item, index) {
                            news += '<div class="div_7 div_01">' +
                                '<div class="span_1 b18"><span class="title_1">考点名称：</span><p class="title_2">' + item.name + '</p></div>' +
                                '<div class="span_1 b18"><span class="title_1">考点地址：</span><p class="title_2">' + item.address + '</p></div>' +
                                '<div class="span_1 b18"><span class="title_1">考点联系人：</span><p class="title_2">' + item.contacts + '</p></div>' +
                                '<div class="span_1 b18"><span class="title_1">联系人手机号：</span><p class="title_2">' + item.mobile + '</p></div>' +
                                '<div class="span_1 b18"><span class="title_1">负责证书：</span><p class="title_2">' + item.profileName + '</p></div>' +
                                '</div>';
                        });
                        $("#news").html(news)
                    }
                });
            }
        });
    }
</script>
<script type="text/javascript" src="/js/xlPaging.js"></script>
</html>